<template>
  <view class="search-item-all">
    <uni-list class="list-group" :border="false">
      <uni-list-item
        v-for="(item, index) in curStringAutoList"
        :key="index"
        :border="true"
      >
        <view
          slot="header"
          class="row-header"
          @click="searchFn(item.tipText, item.requestId)"
        >
          <image class="pic" src="/static/shopIcon/icon-search.png" />
          <text class="name uni-ellipsis-1">{{ item.tipText }}</text>
        </view>
      </uni-list-item>
    </uni-list>
  </view>
</template>

<script>
export default {
  name: 'Index',
  props: {
    stringAutoList: {
      type: Array,
      default: null
    }
  },
  computed: {
    curStringAutoList() {
      return this.stringAutoList
    }
  },
  methods: {
    searchFn(keyword, requestId) {
      this.$emit('searchFn', keyword, requestId)
    }
  }
}
</script>

<style lang="scss" scoped>
.search-item-all{
  clear: both;
  background: $uni-bg-color;
  border-radius: 8rpx;
  margin:16rpx 32rpx 0;
  overflow: hidden;
  .row-header{
    font-size: $uni-font-size-sm;
    margin: 0 -20rpx;
    .pic{
      width: 32rpx;
      height: 32rpx;
      text-align: center;
      overflow: hidden;
      float: left;
      margin-right: 16rpx;
    }
    .name{
      width: 575rpx;
      float: left;
    }
  }
}
</style>
